import { createStore, applyMiddleware } from 'redux';
import { routerMiddleware } from 'react-router-redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';

import reducers from '../reducers';

const configureStore = (history, preloadedState) => createStore(
  reducers,
  preloadedState,
  applyMiddleware(thunk, logger, routerMiddleware(history)),
);

export default configureStore
